package com.yuncheng.spcyApi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuncheng.spcyApi.entity.SpcySqsxBasic;
import com.yuncheng.spcyApi.entity.SpcySqsxJob;
import com.yuncheng.spcyApi.vo.common.OrderItemVo;
import com.yuncheng.spcyApi.vo.flow.KpFlowCommonJobVo;
import com.yuncheng.spcyApi.vo.jcy.JcyJcrcVo;
import com.yuncheng.spcyApi.vo.spcy.SpcyFlowVo;
import com.yuncheng.spcyApi.vo.spcy.SpcyJobVo;
import com.yuncheng.vo.CurrentUserVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Description: 审评查验-培训-答卷答案
 * @Author: csx
 * @Date: 2023-03-03
 * @Version: V1.0
 */
@Component
public interface SpcyFlowMapper extends BaseMapper<SpcySqsxBasic> {

    /** 待办事项 */
    Page<SpcyFlowVo> flowJobPage(Page<SpcyFlowVo> page,
                                 @Param("onlyCurrentUser") boolean onlyCurrentUser,
                                 @Param("user") CurrentUserVo user,
                                 @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo,
                                 @Param("orderBean") OrderItemVo orderItemVo);
    /** 企业待办事项 */
    Page<SpcyFlowVo> flowQyJobPage(Page<SpcyFlowVo> page,
                                 @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo,
                                 @Param("orderBean") OrderItemVo orderItemVo);

    /** 流程监控 */
    Page<SpcyFlowVo> flowJkPage(Page<SpcyFlowVo> page,
                                @Param("onlyCurrentUser") boolean onlyCurrentUser,
                                @Param("user") CurrentUserVo user,
                                @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo,
                                @Param("orderBean") OrderItemVo orderItemVo);

    /** 流程监控 */
    List<SpcyFlowVo> flowJkList(@Param("onlyCurrentUser") boolean onlyCurrentUser,
                                @Param("user") CurrentUserVo user,
                                @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo);

    /** 日常考评待办-旧的 */
    Page<SpcyFlowVo> rckpFlowJobPage(Page<SpcyFlowVo> page,
                                 @Param("onlyCurrentUser") boolean onlyCurrentUser,
                                 @Param("user") CurrentUserVo user,
                                 @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo);

    /** 事项查询-旧的 */
    Page<SpcyFlowVo> flowSqsxPageOld(Page<SpcyFlowVo> page,
                                  @Param("onlyCurrentUser") boolean onlyCurrentUser,
                                  @Param("user") CurrentUserVo user,
                                  @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo,
                                  @Param("orderBean") OrderItemVo orderItemVo);

    /** 经办事项查询 */
    Page<SpcyFlowVo> selectJbSqsxPage(Page<SpcyFlowVo> page,
                                  @Param("userid") String userid,
                                  @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo,
                                  @Param("orderBean") OrderItemVo orderItemVo);

    /** 我的主办事项查询 */
    Page<SpcyFlowVo> selectZbSqsxPage(Page<SpcyFlowVo> page,
                                      @Param("userid") String userid,
                                      @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo,
                                      @Param("orderBean") OrderItemVo orderItemVo);

    /** 事项查询-旧的 */
    Page<SpcyFlowVo> selectSqsxCxPageOld(Page<SpcyFlowVo> page,
                                  @Param("userid") String userid,
                                  @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo,
                                  @Param("orderBean") OrderItemVo orderItemVo);

    /** 事项查询 */
    Page<SpcyFlowVo> selectSqsxCxPage(Page<SpcyFlowVo> page,
                                         @Param("userid") String userid,
                                         @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo,
                                         @Param("orderBean") OrderItemVo orderItemVo);

    /** 预办理事项 - 提取办理-分页查询 */
    Page<SpcyFlowVo> flowPreparePage(Page<SpcyFlowVo> page,
                                     @Param("onlyCurrentUser") boolean onlyCurrentUser,
                                     @Param("user") CurrentUserVo user,
                                     @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo,
                                     @Param("orderBean") OrderItemVo orderItemVo);

    /** 申请事项-我的已办
     * */
    Page<SpcyFlowVo> flowSqsxMyYbPage(Page<SpcyFlowVo> page,
                                      @Param("user") CurrentUserVo user,
                                      @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo);

    /**
     * 查询检查员-检查日常列表
     * @param fsftyxp 同意/不同意
     */
    List<JcyJcrcVo> selectJcyJcrcList(@Param("userid")String userid, @Param("fsftyxp")String fsftyxp);

    /**
     * 日常考评-我的已办
     */
    Page<SpcyFlowVo> selectYbRckpFlowJobPage(Page<SpcyFlowVo> page,
                                         @Param("userid") String userid,
                                         @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo,
                                         @Param("orderBean") OrderItemVo orderItemVo);
    /**
     * 日常考评-查询-旧的
     */
    Page<SpcyFlowVo> selectRckpCxPageListOld(Page<SpcyFlowVo> page,
                                             @Param("userid") String userid,
                                             @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo,
                                             @Param("orderBean") OrderItemVo orderItemVo);

    /**
     * 日常考评-查询
     */
    Page<SpcyFlowVo> selectRckpCxPageList(Page<SpcyFlowVo> page,
                                          @Param("userid") String userid,
                                          @Param("spcyFlowVo") SpcyFlowVo spcyFlowVo,
                                          @Param("orderBean") OrderItemVo orderItemVo);

    /**
     * 通用流程任务查询
     */
    Page<SpcySqsxJob> selectCommonFlowList(Page<SpcySqsxJob> page,
                                           @Param("userid")String userid,
                                           @Param("fhjmc")String fhjmc,
                                           @Param("flcmc")String flcmc,
                                           @Param("fblzt")String fblzt);


    /**
     * 查询我的任务量job
     * @param userid 用户id
     * @param flcmc 流程名称
     * @param fblzt 办理状态
     * @param sfcq 是否超期
     * @param fywflcode 业务科室编码
     * @param year 年份
     * @param yearMonth 年份+月份
     * @return
     */
    List<SpcyJobVo> selectMySpcyRwlList(@Param("userid")String userid,
                                        @Param("flcmc")String flcmc,
                                        @Param("fblzt")String fblzt,
                                        @Param("sfcq")String sfcq,
                                        @Param("fywflcode")String fywflcode,
                                        @Param("year")String year,
                                        @Param("yearMonth")String yearMonth);
    /**
     * 查询我的任务量job
     * @param flcmc 流程名称
     * @return
     */
    List<SpcyJobVo> selectSpcyRwlList(@Param("flcmc")String flcmc,
                                        @Param("kssj")String kssj,
                                        @Param("jssj")String jssj);

    /**
     * 查询我的任务量job
     * @param userid 用户id
     * @return
     */
    List<SpcyJobVo> selectFlowStat(@Param("userid")String userid, @Param("sfcq")String sfcq, @Param("bean")SpcyFlowVo bean);

    /**
     * 查询已经办理现场检查的件
     */
    List<SpcySqsxBasic> selectYbxcjcSxList(@Param("fywflcode") String fywflcode,
                                           @Param("year") String year,
                                           @Param("yearMonth") String yearMonth);

    /**
     * 查询已经办理现场检查的件-查询存在中心人员参与的检查件
     */
    List<SpcySqsxBasic> selectYbxcjcSxInZxcyList(@Param("fywflcode") String fywflcode,
                                                 @Param("year") String year,
                                                 @Param("yearMonth") String yearMonth);

    /**
     * 查询见习待办列表-根据用户id和事项id
     */
    List<KpFlowCommonJobVo> selectJxkpDbByFsqsxidAndFuserid(@Param("sqsxid") String sqsxid, @Param("userid") String userid);

    /**
     * 查询日常考评待办列表-根据用户id和事项id
     */
    List<KpFlowCommonJobVo> selectRckpDbByFsqsxidAndFuserid(@Param("sqsxid") String sqsxid,
                                                      @Param("userid") String userid,
                                                      @Param("flcmc") String flcmc);

    /**
     * 查询日常考评已办列表-根据用户id和事项id
     */
    List<KpFlowCommonJobVo> selectRckpYbByFsqsxidAndFuserid(@Param("sqsxid") String sqsxid,
                                                            @Param("userid") String userid,
                                                            @Param("flcmc") String flcmc);

}
